<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位-固定定位</title>
    <style>
        .centent {
            width: 80%;
            height: auto;
            margin: 15px auto;
        }

        .back {
            width: 50px;
            height: 120px;
            background-color: orange;

            /* 固定定位 */
            position: fixed;
            right: 0;
            bottom: 0;

            text-align: center;
            padding-top: 25px;
        }
    </style>
</head>

<body>
    <!-- 锚点 -->
    <a id="top"></a>
    <div class="centent">
        <img src="box.png" />
    </div>
    <div class="back"><a href="#top">回<br />到<br />顶<br />部<br /></a></div>
</body>

</html>